package com.gitee.fsmxm.thinking.in.spring.bean.definition;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * bean 别名 demo
 */
public class BeanAliasDemo {

    public static void main(String[] args) {

        BeanFactory beanFactory = new ClassPathXmlApplicationContext("classpath:/META-INF/bean-definition-context.xml");
        Object bean = beanFactory.getBean("xiaomage-user");

        Object user = beanFactory.getBean("user");

        System.out.println("user == xiaomage-user ? " + (user == bean));

    }

}
